package _thread_lock._futurepattern._future2;

/**
 * @Author: huangya
 * @Date: 2020/10/27
 * @Description:
 */
public class ExecuteServiceImpl<V> implements ExecuteService<V> {
    @Override
    public void submit(Task<V> task, Future future) {
        new Thread(() -> {
            V taskResult = task.exec();
            future.finish(taskResult);
        }).start();
    }
}
